package com.ruoyi.chy.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.chy.mapper.GroupPurchaseMapper;
import com.ruoyi.chy.domain.GroupPurchase;
import com.ruoyi.chy.service.IGroupPurchaseService;

/**
 * 优惠团购Service业务层处理
 * 
 * @author liuweichao
 * @date 2025-05-30
 */
@Service
public class GroupPurchaseServiceImpl implements IGroupPurchaseService 
{
    @Autowired
    private GroupPurchaseMapper groupPurchaseMapper;

    /**
     * 查询优惠团购
     * 
     * @param id 优惠团购主键
     * @return 优惠团购
     */
    @Override
    public GroupPurchase selectGroupPurchaseById(Integer id)
    {
        return groupPurchaseMapper.selectGroupPurchaseById(id);
    }

    /**
     * 查询优惠团购列表
     * 
     * @param groupPurchase 优惠团购
     * @return 优惠团购
     */
    @Override
    public List<GroupPurchase> selectGroupPurchaseList(GroupPurchase groupPurchase)
    {
        return groupPurchaseMapper.selectGroupPurchaseList(groupPurchase);
    }

    /**
     * 新增优惠团购
     * 
     * @param groupPurchase 优惠团购
     * @return 结果
     */
    @Override
    public int insertGroupPurchase(GroupPurchase groupPurchase)
    {
        return groupPurchaseMapper.insertGroupPurchase(groupPurchase);
    }

    /**
     * 修改优惠团购
     * 
     * @param groupPurchase 优惠团购
     * @return 结果
     */
    @Override
    public int updateGroupPurchase(GroupPurchase groupPurchase)
    {
        return groupPurchaseMapper.updateGroupPurchase(groupPurchase);
    }

    /**
     * 批量删除优惠团购
     * 
     * @param ids 需要删除的优惠团购主键
     * @return 结果
     */
    @Override
    public int deleteGroupPurchaseByIds(Integer[] ids)
    {
        return groupPurchaseMapper.deleteGroupPurchaseByIds(ids);
    }

    /**
     * 删除优惠团购信息
     * 
     * @param id 优惠团购主键
     * @return 结果
     */
    @Override
    public int deleteGroupPurchaseById(Integer id)
    {
        return groupPurchaseMapper.deleteGroupPurchaseById(id);
    }
}
